unit udata;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, sqldb, db, IBConnection, FileUtil, IniFiles, Dialogs;

type

  { TDataModule1 }

  TDataModule1 = class(TDataModule)
    MinZar_DataSource: TDataSource;
    DIC_DataSource: TDataSource;
    DIC_IBConnection: TIBConnection;
    DIC_SQLQuery: TSQLQuery;
    DIC_SQLTransaction: TSQLTransaction;
    DIC_SQLQueryWRITE: TSQLQuery;
    MinZar_SQLQuery: TSQLQuery;
    procedure DataModuleCreate(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  DataModule1: TDataModule1;
  INI:TIniFile;

implementation

{$R *.lfm}

{ TDataModule1 }

procedure TDataModule1.DataModuleCreate(Sender: TObject);
begin
     INI:=TINIFile.Create(GetUserDir+'bsalary'+DirectorySeparator+'settings.ini');
   try
     DIC_IBConnection.HostName :=INI.ReadString('DB','HOSTNAME',DIC_IBConnection.HostName);
     DIC_IBConnection.DatabaseName:=INI.ReadString('DB','FILE',DIC_IBConnection.DatabaseName);
     DIC_IBConnection.UserName:=INI.ReadString('DB','USER',DIC_IBConnection.UserName);
     DIC_IBConnection.Password:=INI.ReadString('DB','PASSWORD',DIC_IBConnection.Password);
   except
         ShowMessage('Нема доступу до бази даних');
   end;
end;

end.

